summaryrefslogtreecommitdiff
path: root/src/pages/blogs/[...slug].astro
blob: 33bfc842f0f78f91f9d34a8d1c3892e33363042b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
import Blog from "@layouts/Blog.astro";
import { getCollection } from "astro:content";

export async function getStaticPaths() {
    const blogEntries = await getCollection("blogs");
    return blogEntries.map((entry) => ({
        params: { slug: entry.slug },
        props: { entry },
    }));
}

const { entry } = Astro.props;
const { Content } = await entry.render();
---

<Blog title=`/home/kyren/blogs/${entry.slug}`>
    <Content />
</Blog>